package com.shine.spring.boot.action.websocket.controller.api;

import com.shine.spring.boot.action.websocket.service.WebSocketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Forward Seen
 * @description:
 * @createTime: 2023/9/28 15:24
 * @since: 1.0
 */
@Slf4j
@RestController
@RequestMapping("/websocket")
public class WebSocketController {

    @RequestMapping("/sendMessage")
    public String sendMessage() {
        String msg = "这是一条测试消息";
        WebSocketService.publish(msg);
        return msg;
    }
}
